local P = {}

function P:UpdateEffect (camera, distance, minDistance, maxDistance)
    if Time.time - self.lastTime < self.intervalTime then
        return
    end

    self.lastTime = Time.time

    -- float temp = Mathf.Lerp(minDistanceRadius, maxDistanceRadius, (distance - minDistance) / (maxDistance - minDistance));

    local temp = self.radius * distance / minDistance
    local randomRadius = math.random() * temp
    local randomAngle = math.random() * Mathf.PI * 2
    local x = Mathf.Cos(randomAngle) * randomRadius
    local y = Mathf.Sin(randomAngle) * randomRadius
    camera.transform.localPosition = Vector3.New(x, y, 0)
end

function P:Destroy(camera)
    if not camera then
        return
    end

    camera.transform.localPosition = Vector3.zero
end

return P